
def data_format(data: str or dict):
    if isinstance(data, str):
        return {'text': data}
    else:
        return data


def parse(testsuit):
    '''
    将测试用例解析为可执行参数，如:
    打开首页，解析为：OPEN 127.0.0.1
    '''
    for testcase in testsuit:
        for step in testcase['steps']:
            step['data'] = data_format(step['data'])
            step['expected'] = data_format(step['expected'])
            step['output'] = data_format(step['output'])
